ACCESS
Section: MINTLIB LIBRARY FUNCTIONS
(3)
Updated: 3 March 1993
Index
Return to Main Contents
NAME
access - determine accessibility of a file
SYNOPSIS
#include <unistd.h>
int access(const char *path, int amode);
DESCRIPTION
path points to a path naming a file. access checks the named
file for accessibility, using the real user ID and real group
ID of the process. The bit pattern contained in amode is
constructed as follows:
04: read
02: write
01: execute (search for directories)
00: check existence of file
The owner of a file has permission checked with respect to
the "owner" read, write and execute mode bits. Members of
the file's group other than the owner have permissions checked
with respect to the "group" mode bits, and all others have
permissions checked with respect to the "other" mode bits.
If the real user ID is 0 (super-user), success is always
returned for any existing file.
SEE ALSO
chmod(3),
stat(3)
RETURN VALUES
0 if access is permitted.
-1 if access is not permitted or if the file does not exist;
errno is set to indicate the error.
NOTE
Under TOS or on a MS-DOS (TOS) file-system, this call is pretty
bogus and can best be used to check for existence of the file.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- SEE ALSO
-
- RETURN VALUES
-
- NOTE
-
This document was created by
man2html,
using the manual pages.
Time: 11:14:43 GMT, June 22, 2025